<?php

	class Teacher
	{
		var $teacher_id;
		var $teacher_username;
		var $teacher_password;
		var $teacher_firstname;
		var $teacher_lastname;
		var $teacher_ncuid;
		var $teacher_email;
		var $teacher_tel;
		var $teacher_faculty;
		
		
		public function getTeacherId()
		{
			return $this->teacher_id;
		}
		public function setTeacherId($teacher_id)
		{	
			$this->teacher_id=$teacher_id;
		}


		public function getTeacherUsername()
		{
			return $this->teacher_username;
		}
		public function setTeacherUsername($teacher_username)
		{
			$this->teacher_username=$teacher_username;
		}


		public function getTeacherPassword()
		{
			return $this->teacher_password;
		}
		public function setTeacherPassword($teacher_password)
		{
			$this->teacher_password=$teacher_password;
		}
		
		public function getTeacherFirstname()
		{
			return $this->teacher_firstname;
		}
		public function setTeacherFirstname($teacher_firstname)
		{
			$this->teacher_firstname=$teacher_firstname;
		}

		public function getTeacherLastname()
		{
			return $this->teacher_lastname;
		}
		public function setTeacherLastname($teacher_lastname)
		{
			$this->teacher_lastname=$teacher_lastname;
		}

		public function getTeacherNcuId()
		{
			return $this->teacher_ncuid;
		}
		public function setTeacherNcuId($teacher_ncuid)
		{
			$this->teacher_ncuid=$teacher_ncuid;
		}

		public function getTeacherEmail()
		{
			return $this->teacher_email;
		}
		public function setTeacherEmail($teacher_email)
		{
			$this->teacher_email=$teacher_email;
		}

		public function getTeacherTel()
		{
			return $this->teacher_tel;
		}
		public function setTeacherTel($teacher_tel)
		{
			$this->teacher_tel=$teacher_tel;
		}

		public function getTeacherFaculty()
		{
			return $this->teacher_faculty;
		}
		public function setTeacherFaculty($teacher_faculty)
		{
			$this->teacher_faculty=$teacher_faculty;
		}

		public function teacherLogin($teacherusername,$teacherpassword)
		{
			$query = mysql_query('SELECT * FROM teachermember WHERE 
			teacher_username = "'.$teacherusername.'" AND 
			teacher_password = "'.$teacherpassword.'" ')or die (mysql_error());

			$count = mysql_num_rows($query);
			if ($count!=0)
			{
				
				 $_SESSION['teacher_id'] = session_id;
				 $_SESSION['teacher_username'] = $teacherusername;
				echo 'good';
			}
				echo "PASS";
		}
		public function teacherLogout()
		{

		}

		public function teacherRegister($teacher_username,$teacher_password,$teacher_firstname,$teacher_lastname,$teacher_ncuid,$teacher_email,$teacher_tel,$teacher_faculty)
		{
			mysql_query('INSERT INTO teachermember (teacher_username,teacher_password,teacher_firstname,teacher_lastname,teacher_ncuid,teacher_email,teacher_tel,teacher_faculty) VALUES
			(
				"'.$teacher_username.'","'.$teacher_password.'","'.$teacher_firstname.'","'.$teacher_lastname.'","'.$teacher_ncuid.'","'.$teacher_email.'","'.$teacher_tel.'","'.$teacher_faculty.'"
			)
			')or die(mysql_error());   
			return true;
		}
		public function teacherForgotpassword($teacher_username,$teacher_firstname,$teacher_ncuid,$teacher_email)
		{
			$query = mysql_query('SELECT teacher_password FROM teachermember WHERE 
			teacher_username = "'.$teacher_username.'" AND 
			teacher_firstname = "'.$teacher_firstname.'" AND 
			teacher_ncuid = "'.$teacher_ncuid.'" AND 
			teacher_email = "'.$teacher_email.'" LIMIT 1')or die (mysql_error());

			$count = mysql_fetch_array($query);
			if ($count==0)
			{
				echo "";
			}
			return $count['teacher_password'];
		}
		public function teacherEditprofile()
		{

		}
		public function teacherShowprofile()
		{

		}
		public function teacherAddInformation($inf_title,$inf_date,$inf_subject,$inf_faculty,$inf_detail)
		{
			mysql_query('INSERT INTO main_information (inf_title,inf_date,inf_subject,inf_faculty,inf_detail) VALUES
			(
				"'.$inf_title.'","'.$inf_date.'","'.$inf_subject.'","'.$inf_faculty.'","'.$inf_detail.'"
			)
			')or die(mysql_error());   
			return true;
			
		}
		public function teacherDeleteInformation()
		{

		}
		public function teacherEditInformation()
		{

		}



	}
?>